package com.service.dao.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.service.dao.model.SysBorrowConfig;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SysBorrowConfigMapper extends BaseMapper<SysBorrowConfig> {

    /**
     * 查询最新借贷系统配置
     * @return
     */
    @Select("select * from sys_borrow_config where status = 1 order by create_time desc limit 1")
    SysBorrowConfig getLastBorrowConfig();

    /**
     * 查询对应币种借贷配置
     * @param coinId
     * @return
     */
    SysBorrowConfig getCoinBorrowConfig(@Param("coinId") int coinId);
}